package enterprise.web.tookit.generic;

import java.io.Serializable;

import javax.persistence.EntityTransaction;
import javax.persistence.FlushModeType;
import javax.persistence.LockModeType;

/**
 * @since 29/08/2012
 * 
 * @author regisrocha
 * 
 * @description Class implementation for methods commons to Dao's
 * 
 */
public interface GenericDao extends Serializable {

	public void persist(Object entity);

	public void remove(Object entity);

	public void flush();

	public void setFlushMode(FlushModeType flushMode);

	public FlushModeType getFlushMode();

	public void lock(Object entity, LockModeType lockMode);

	public void refresh(Object entity);

	public void clear();

	public boolean contains(Object entity);

	public boolean isOpen();

	public EntityTransaction getTransaction();

	public <T> T merge(T t);

	public <T> T findByPrimaryKey(Class<T> entityClass, Object primaryKey);

}
